package cz.khfotbal.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "SEASON_COMPETION_TEAM")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SeasonCompetionTeam {

	@Id
	@GeneratedValue
	private int id;

	private Integer number;
	private String playTime;
	private String playDay;

	@ManyToOne
	@JoinColumn(name = "SEASON_COMPETION_ID")
	private SeasonCompetion seasonCompetion;

	@ManyToOne
	@JoinColumn(name = "TEAM_ID")
	private Team team;

	@OneToMany(mappedBy = "seasonCompetionTeam", cascade = CascadeType.ALL)
	private Set<SeasonCompetionTeamMatch> seasonCopetionTeamMatches;

	// @OneToMany(mappedBy="seasonCompetionTeam", cascade=CascadeType.ALL,
	// fetch=FetchType.EAGER)
	// private Set<SeasonCompetionTeamPlayer> seasonCompetionTeamPlayers;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public SeasonCompetion getSeasonCompetion() {
		return seasonCompetion;
	}

	public void setSeasonCompetion(SeasonCompetion seasonCompetion) {
		this.seasonCompetion = seasonCompetion;
	}

	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	public Set<SeasonCompetionTeamMatch> getSeasonCopetionTeamMatches() {
		return seasonCopetionTeamMatches;
	}

	public void setSeasonCopetionTeamMatches(
			Set<SeasonCompetionTeamMatch> seasonCopetionTeamMatches) {
		this.seasonCopetionTeamMatches = seasonCopetionTeamMatches;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	public String getPlayTime() {
		return playTime;
	}

	public void setPlayTime(String playTime) {
		this.playTime = playTime;
	}

	public String getPlayDay() {
		return playDay;
	}

	public void setPlayDay(String playDay) {
		this.playDay = playDay;
	}

	// public Set<SeasonCompetionTeamPlayer> getSeasonCompetionTeamPlayers() {
	// return seasonCompetionTeamPlayers;
	// }
	//
	// public void setSeasonCompetionTeamPlayers(
	// Set<SeasonCompetionTeamPlayer> seasonCompetionTeamPlayers) {
	// this.seasonCompetionTeamPlayers = seasonCompetionTeamPlayers;
	// }

}
